package com.tcl.logasm;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.tcl.utilcode.LogConfig;
import com.tcl.utilcode.managers.ExternalConfigManager;
import com.tcl.utilcode.util.LogUtils;
import com.tcl.utilcode.util.SPUtils;

public class MainActivity extends AppCompatActivity {
 int i =100;
 int j = 200;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        int y =1000;
        Log.e("zuojie", "isLogInfo"+ExternalConfigManager.getInstance().isLogInfo());
//        boolean isShow = SPUtils.getInstance().getBoolean("isShow");
//        LogConfig.LOGD_ENABLED = isShow;
//        LogUtils.getConfig().setLogHeadSwitch(false).setBorderSwitch(false);
        LogUtils.e("===onCreate==="+i+",j==="+j+",y=="+y);
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (true){
//                    LogUtils.eTag("","===Thread===");
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }).start();
        LogUtils.e("===onCreate=jjjj==="+j);
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (true){
//                    LogUtils.eTag("","===Thread222===");
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }).start();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
//        if(LogConfig.LOGD_ENABLED)
        LogUtils.e("===onDestroy===");
        System.exit(0);
    }

    public void onButClick(View view) {
        boolean isShow = SPUtils.getInstance().getBoolean("isShow");

        SPUtils.getInstance().put("isShow",!isShow );
        Log.e("zuojie","!isShow ="+!isShow );
    }
}